
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>安全验证 - 人机验证</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <script type="text/javascript"
    	src="//cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            transition: background 0.5s;
        }

        body.light-mode {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        }

        .container {
            width: 100%;
            max-width: 450px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            transition: all 0.3s ease;
        }

        body.light-mode .container {
            background: rgba(255, 255, 255, 0.95);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .header {
            background: #4a6bdf;
            color: white;
            padding: 25px;
            text-align: center;
            position: relative;
        }

        body.light-mode .header {
            background: #5c7cfa;
        }

        .header h1 {
            font-size: 1.8rem;
            margin-bottom: 5px;
        }

        .header p {
            font-size: 1rem;
            opacity: 0.9;
        }

        .theme-toggle {
            position: absolute;
            top: 20px;
            right: 20px;
            background: rgba(255, 255, 255, 0.2);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: all 0.3s;
        }

        .theme-toggle:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .content {
            padding: 25px;
        }

        .captcha-types {
            display: flex;
            justify-content: space-between;
            margin-bottom: 20px;
            border-bottom: 1px solid #eee;
            padding-bottom: 15px;
        }

        .captcha-type {
            flex: 1;
            text-align: center;
            padding: 10px;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.3s;
            margin: 0 5px;
        }

        .captcha-type.active {
            background: #e6eeff;
            font-weight: 600;
        }

        body.light-mode .captcha-type.active {
            background: #f0f4ff;
        }

        .captcha-type i {
            font-size: 1.5rem;
            margin-bottom: 8px;
            color: #4a6bdf;
        }

        .captcha-container {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 25px;
            min-height: 200px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        body.light-mode .captcha-container {
            background: #f0f2f5;
        }

        .captcha-image {
            background: #fff;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .captcha-image img {
            max-width: 100%;
            border-radius: 4px;
        }

        .captcha-text {
            font-size: 24px;
            letter-spacing: 5px;
            font-weight: bold;
            color: #333;
            padding: 10px;
            background: #f1f1f1;
            border-radius: 4px;
            margin: 15px 0;
            user-select: none;
        }

        .captcha-input {
            width: 100%;
            padding: 15px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 1rem;
            margin-bottom: 15px;
            transition: all 0.3s;
        }

        .captcha-input:focus {
            border-color: #4a6bdf;
            outline: none;
        }

        .slider-container {
            width: 100%;
            margin: 20px 0;
        }

        .slider-track {
            width: 100%;
            height: 50px;
            background: #e9ecef;
            border-radius: 25px;
            position: relative;
            overflow: hidden;
        }

        .slider-thumb {
            width: 50px;
            height: 50px;
            background: #4a6bdf;
            border-radius: 50%;
            position: absolute;
            top: 0;
            left: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            color: white;
            cursor: pointer;
        }

        .slider-text {
            position: absolute;
            width: 100%;
            text-align: center;
            line-height: 50px;
            color: #6c757d;
            font-weight: 500;
            user-select: none;
        }

        .action-buttons {
            display: flex;
            justify-content: space-between;
        }

        .btn {
            flex: 1;
            padding: 15px;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin: 0 5px;
        }

        .btn-refresh {
            background: #e9ecef;
            color: #495057;
        }

        .btn-refresh:hover {
            background: #dee2e6;
        }

        .btn-submit {
            background: #4a6bdf;
            color: white;
        }

        .btn-submit:hover {
            background: #3a5bce;
        }

        .footer {
            padding: 20px;
            text-align: center;
            color: #6c757d;
            font-size: 0.9rem;
            background: #f8f9fa;
            border-top: 1px solid #eee;
        }

        body.light-mode .footer {
            background: #f0f2f5;
        }

        .success-message {
            color: #28a745;
            text-align: center;
            margin-top: 15px;
            font-weight: 500;
            display: none;
        }

        @media (max-width: 500px) {
            .container {
                border-radius: 12px;
            }

            .header {
                padding: 20px 15px;
            }

            .header h1 {
                font-size: 1.5rem;
            }

            .content {
                padding: 20px 15px;
            }

            .captcha-types {
                flex-direction: column;
            }

            .captcha-type {
                margin: 5px 0;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">

            <h1>安全验证</h1>
            <p>请完成以下验证以继续</p>
        </div>

        <div class="content">


            <div class="captcha-container">


                <div class="slider-container">
                    <div class="slider-track">
                        <div class="slider-text">向右滑动完成验证</div>
                        <div class="slider-thumb" onmousedown="startSlide(event)" ontouchstart="startSlide(event)">
                            <i class="fas fa-arrow-right"></i>
                        </div>
                    </div>
                </div>




        </div>


    </div>

    <script>
        // 当前验证码类型（0:文字，1:滑动，2:点击）
        let currentCaptchaType = 0;
        let isVerified = false;
        let isSliding = false;
        let startX = 0;
        let sourceUrl = 'https://www.huizone.com/t/p/css/swiper.4.5.3.min.css';

        let basePath = '//www.huizone.com:443/';
        var result = false;
        // 刷新验证码
        function refreshCaptcha() {
            if (isVerified) {
                document.getElementById('successMessage').style.display = 'none';
                isVerified = false;
            }


			// 重置滑动验证
			document.querySelector('.slider-thumb').style.left = '0px';
			document.querySelector('.slider-text').textContent = '向右滑动完成验证';

        }

        // 开始滑动
        function startSlide(e) {
            e.preventDefault();
            isSliding = true;
            startX = e.clientX || e.touches[0].clientX;
            document.addEventListener('mousemove', slideMove);
            document.addEventListener('touchmove', slideMove);
            document.addEventListener('mouseup', stopSlide);
            document.addEventListener('touchend', stopSlide);
        }

        // 滑动中
        function slideMove(e) {
            if (!isSliding) return;

            const currentX = e.clientX || e.touches[0].clientX;
            const sliderTrack = document.querySelector('.slider-track');
            const sliderThumb = document.querySelector('.slider-thumb');
            const sliderText = document.querySelector('.slider-text');

            let newLeft = currentX - startX;
            if (newLeft < 0) newLeft = 0;
            if (newLeft > sliderTrack.offsetWidth - sliderThumb.offsetWidth) {
                newLeft = sliderTrack.offsetWidth - sliderThumb.offsetWidth;
                // 滑动到最右边，验证成功
                sliderText.textContent = '验证成功';
                isVerified = true;
                validateCaptcha();
            }

            sliderThumb.style.left = newLeft + 'px';
        }

        // 停止滑动
        function stopSlide() {
            isSliding = false;
            document.removeEventListener('mousemove', slideMove);
            document.removeEventListener('touchmove', slideMove);
            document.removeEventListener('mouseup', stopSlide);
            document.removeEventListener('touchend', stopSlide);

            if (!isVerified) {
                // 如果没有验证成功，重置滑块
                document.querySelector('.slider-thumb').style.left = '0px';
            }
        }

        // 验证验证码
        function validateCaptcha() {
            if (isVerified) {
                showSuccess();
                return;
            }

			if (isVerified) {
				showSuccess();

			} else {
				alert('请完成滑动验证');
			}

        }

         // 显示成功消息
         function showSuccess() {
             if(result){
                 return;
             }
             result = true;
             $.ajax({
                 url : basePath + 'vapachaSuccess.do',
                 type : 'POST',
                 dataType : 'json',
                 data : {

                 },
                 success : function(json) {
                          result = false;
                         location.href = sourceUrl;

                 }
             });
         }


        // 初始化
        window.onload = function() {
            refreshCaptcha();
        };
    </script>
</body>
</html>